﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpGuiMainFrameInterface.h"
#include "OwnerPtr.h"

#include <vector>

namespace gcmp
{
    class ICommandButtonDefinition;
    class ICommandButtonMenuDefinition;
    class IControl;
    class IQuickAccessBarHandler;

    //快捷工具条接口
    FINAL_INTERFACE class GCMP_GUI_MAIN_FRAME_INTERFACE_EXPORT IRibbonQuickAccessBar
    {
    public:
        /// \brief 析构函数
        virtual ~IRibbonQuickAccessBar();

        /// \brief 添加button至最后
        /// 
        /// \param pCommandButtonDefinition ICommandButtonDefinition对象
        /// \return bool true表示成功，false表示失败; 添加时会判断pCommandButtonDefinition是否添加过，添加过会失败
        virtual bool AddButton(OwnerPtr<ICommandButtonDefinition> pCommandButtonDefinition) = 0;

        /// \brief 添加buttonMenu至最后
        /// 
        /// \param pCommandButtonMenuDefinition ICommandButtonMenuDefinition对象
        /// \return  true表示成功，false表示失败,添加时会判断pCommandButtonMenuDefinition是否添加过，添加过会失败
        virtual bool AddButtonMenu(OwnerPtr<ICommandButtonMenuDefinition> pCommandButtonMenuDefinition) = 0;

        /// \brief 得到该工具条上所有控件
        ///
        /// \return  控件集合
        virtual std::vector<IControl*> GetAllControls() const = 0;

        /// \brief 设置快捷工具条的可见状态
        ///
        /// \param opQuickAccessBarHandler 快捷工具条的控制对象
        /// \return     true表示成功，false表示失败，右快捷工具条暂不支持此设置，将返回false
        virtual bool SetQuickAccessBarHandler(OwnerPtr<IQuickAccessBarHandler> opQuickAccessBarHandler) = 0;

        /// \brief 得到QuickAccessBar的可见性
        ///
        /// \return  返回true表示可见，返回false表示不可见
        virtual bool IsVisible() const = 0;

        /// \brief 删除Control
        ///
        /// \param id control对应id
        /// \return     true表示成功，false表示失败
        virtual bool DeleteControl(const std::wstring& id) = 0;
    };

}   // end namespace gcmp
